﻿/** Copyright © 2010-2015 Vahid Jalili
 * 
 * This file is part of ReShapes project.
 * ReShapes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 * ReShapes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with Foobar. If not, see http://www.gnu.org/licenses/.
 **/

using System.Windows;
using System.Windows.Input;
using System.Windows.Media;

namespace ReShapes
{
    /// <summary>
    /// Interaction logic for Export_Results.xaml
    /// </summary>
    public partial class Export_Results : Window
    {

        SolidColorBrush Button_Mouse_Enter_Color = new SolidColorBrush(Colors.Yellow);
        SolidColorBrush Button_Mouse_Leave_Color = new SolidColorBrush(Color.FromArgb(255, 128, 128, 128));

        string[] r = new string[]
        {            
            "Path",
            "Reasoning Result",
            "Gamma",
            "Alpha",
            "Landmarks",
            "Differences"
        };

        public Export_Results()
        {
            InitializeComponent();
        }

        private void Cancel_BT_MouseEnter(object sender, MouseEventArgs e)
        {
            Cancel_BT.Foreground = Button_Mouse_Enter_Color;
        }
        private void Cancel_BT_MouseLeave(object sender, MouseEventArgs e)
        {
            Cancel_BT.Foreground = Button_Mouse_Leave_Color;
        }
        private void Cancel_BT_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }

        private void Export_BT_MouseEnter(object sender, MouseEventArgs e)
        {
            Export_BT.Foreground = Button_Mouse_Enter_Color;
        }
        private void Export_BT_MouseLeave(object sender, MouseEventArgs e)
        {
            Export_BT.Foreground = Button_Mouse_Leave_Color;
        }
        private void Export_BT_MouseDown(object sender, MouseButtonEventArgs e)
        {
            r[0] = Path_TB.Text.Trim();

            if (Results_CB.IsChecked == true) r[1] = "1"; else r[1] = "0";
            if (gamma_Set_CB.IsChecked == true) r[2] = "1"; else r[2] = "0";
            if (Alph_Set_CB.IsChecked == true) r[3] = "1"; else r[3] = "0";
            if (Fig_Meets_CB.IsChecked == true) r[4] = "1"; else r[4] = "0";
            if (Differences_CB.IsChecked == true) r[5] = "1"; else r[5] = "0";

            this.Close();
        }

        public string[] Result()
        {
            return r;
        }
    }
}
